<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>国省自检--${fns:getConfig('productName')}</title>
<link rel="stylesheet" href="${ctx}/styles/gsjcss/common.css">
<script type="text/javascript">
    function btnClick(){
        var url = '${ctx}/enforFund/search.do?projectId=${fns:encodeParamUrl(projectId)}&menuId=${fns:encodeParamUrl(menuId)}';
        var data = {};
       	data['retrieval'] = getJson('condition');
        loadData(url,data);
    }
    //ajax执行成功之后的回调方法
    function loadDataToTable(data){
    	var attData = data['att'];
    	var score = data['score'];
    	var manageData = data['manageData'];
        var percent = data['percent'];
        //检索附件的回调方法
        loadAttachment(attData);
        //检索文件的回调方法
        loadAttachment(manageData[0].attachments);
      	if (data["flag"]){
        	var content = '<table style="width:98%;text-align:center;margin-top:5px;font-family:verdana;color:black"" border="1" ><thead>'+
								'<tr style="height:45px">'+				
								'<th rowspan="2">年度</th>'+
								'<th colspan="3">预算经费（万元）</th>'+
								'<th rowspan="2">核对人员数</th>'+
								'<th rowspan="2">预算单价（万元/人）</th>'+
								'<th rowspan="2">路政车辆（辆）</th>'+
								'<th rowspan="2">是否纳入财政预算管理</th>'+
								'<th rowspan="2">检查得分</th>'+
								'<th rowspan="2">完善度</th></tr>'+
								'<tr><th>省</th><th>市</th><th>县</th><tr></thead><tbody>';
			content +='<tr><td>'+manageData[0].year+'</td><td>'+manageData[0].budgetPro+'</td><td>'+manageData[0].budgetary+'</td><td>'
					+manageData[0].budgetCou+'</td><td>'+manageData[0].personCount+'</td><td>'+manageData[0].budgetPrice+'</td><td>'+manageData[0].carCount+'</td>';
			if(manageData[0].ifInto == "1"){
                content += "<td>"+imgRight+"</td>";
            } else {
                content +="<td>"+imgError+"</td>";
            }
			content += '</td><td rowspan="3" class="sumTd">'+score+'</td><td rowspan="3" class="perTd">'+percent+'%</td></tr>';
			content += '<tr rowspan="2" style="height:40px"><td rowspan="2">'+"备注"+'</td><td colspan="7" rowspan="2">'+"其中省级公路路政核定人员"+manageData[0].actRoadPeo+"人，全省补助经费预算"+manageData[0].actRoadBudget+"万元；省级交通综合执法核定人员"+manageData[0].actComPeo+"人，预算经费"+manageData[0].actComBudget+"万元。"+'</td></tr></tbody></table>';
			console.log(content);
			$('#checkResult').append(content);
		}
    }
</script>
</head>
<body>
	<div id="x_top"></div>
	<tags:message content="${msg}" />
	<c:if test="${not empty checkTable.id}">
		<div style="text-align:center">
			<a href="javascript:void(0);" class="btn btn-primary" onclick="downWord('${ctx}/enforFund/downWord.do?projectId=${fns:encodeParamUrl(projectId)}&menuId=${fns:encodeParamUrl(menuId)}');" id= "btnDown" role="button" ><div id="x_v"></div></a>
		</div>
	</c:if>
    <form id="checkForm" class="form-horizontal"  method="POST"  name="checkForm" action="${ctx}/enforFund/save.do?left=${fns:encodeParam(left)}&top=${fns:encodeParam(top)}&projectId=${fns:encodeParam(projectId)}&menuId=${fns:encodeParam(menuId)}&leftChild=${fns:encodeParam(leftChild)}">
        <input type="hidden" name="token" value="${token}">
        <div id="show">
            <div id="showTable" class="showTable">
                <jsp:include page="/WEB-INF/views/check/common.jsp"/> 
                <div class="model">
					<div>
						<legend>三、检查条件及设置</legend>
						<div class="content-title" id="condition">
							<div style="float: left; margin-right: 10px;">
								<div>
									<div>
										<span>年份：</span> <select name="itemProjectId"
											id="itemProjectId">
											<option selected="selected" value="">请选择</option>
											<c:forEach items="${fns:getEnforFundYear(projectId)}" var="year" varStatus="idxStatus">
												<option value="${year.year}">${year.year}</option>
											</c:forEach>
										</select>
									</div>
									<div style="margin-top: 15px;">
										<span>经费纳入财政预算管理满分<font style="color: red;">*</font>：</span> 
											<input type="text" name="yearFull" id="yearFull" maxlength="6" class="required conInput" value='2'>
										<span style="margin-left: 20px">预算经费按人员配置并满足工作要求满分<font style="color: red;">*</font>：</span> 
											<input type="text" name="yearPart" id="yearPart" maxlength="6" class="required conInput" value='2'>
									</div>
								</div>
								<div>
									<div style="margin-top: 15px;">
										<span>经费与预算相差合理范围（万元）<font style="color: red;">*</font>：</span> 
											<input type="text" name="poitMark" id="poitMark" maxlength="6" class="required conInput" value='200'>
										<span style="margin-left: 20px">核对人员允许相差范围<font style="color: red;">*</font>：</span> 
											<input type="text" name="reserveMark" id="reserveMark" maxlength="6" class="required conInput" value='1'>
									</div>
								</div>
							</div>
							<div id="x_s" style="float: right">
								<div class="x_ico"></div>
								<a href="#javascript:void(0)" onclick="btnClick();"
									id="btnSearch" role="button">搜索&nbsp;</a>
							</div>
						</div>
					</div>
					<div class="model">
                    <div>
                    	<legend>四、检索结果</legend>
                        <div class="content-title">
                            <div class="tabbox">
                                <div class="tab">
                                <a href="javascript:;" class="on">规章制度</a>
                                    <c:forEach items="${childMenuList}" var="menu"  varStatus="idxStatus">
                                        <c:if test="${idxStatus.index >= 2}">
                                            <a href="javascript:;">${menu.name}</a>
                                        </c:if>
                                    </c:forEach>
                                </div>
                                <div class="content">
                                    <ul>
                                        <c:forEach items="${childMenuList}" var="menu" varStatus="idxStatus">
                                            <c:if test="${idxStatus.index >= 1}">
                                                <li>
                                                    <table style="width:98%;text-align:center;margin-top:5px;" border="1" id="${menu.tag}">
                                                        <thead>
                                                            <th>序号</th>
                                                            <th>操作</th>
                                                            <th>发文单位</th>
                                                            <th>上传用户</th>
                                                            <th>文件名</th>
                                                            <th>发文日期</th>
                                                            <th>上传日期</th>
                                                            <th>文件大小</th>
                                                            <th>文件类型</th>
                                                        </thead>
                                                        <tbody>
                                                            
                                                        </tbody>
                                                    </table>
                                                </li>
                                            </c:if>
                                        </c:forEach>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="model">
                    <div>
                    	<legend>五、检查评分</legend>
                        <div class="context-title" id="checkResult">
                        
                        </div>
                    </div>
                </div>
                <div class="model">
                    <div class="content-btn">
                        <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <input id="btnCancel" class="btn" type="button" value="返 回" onclick="toBack()" />
                    </div>
                </div>
            </div>
        </div>
    </form>
    <script src="${ctxStatic}/js/check/checkCommon.js" type="text/javascript"></script>
</body>
</html>